# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=baloo-widgets
pkgver=24.08.2
pkgrel=0
pkgdesc="Widgets for Baloo"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/Baloo"
license="LGPL-2.0-only AND LGPL-2.1-or-later"
depends_dev="
	baloo-dev
	kconfig-dev
	kfilemetadata-dev
	ki18n-dev
	kio-dev
	qt6-qtbase-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/libraries/baloo-widgets.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/baloo-widgets-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DBUILD_WITH_QT6=ON \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	dbus-run-session -- xvfb-run -a ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
553929a643861e9b4dfdd3a5d889bd3df30c0865d51222b8febb2cd88df97e0bc4f7005c2a8ae65445f52da65af52974d1dee2ef5cb1a883e2d1326ee8f7a6fe  baloo-widgets-24.08.2.tar.xz
"
